<!doctype html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>提瓦特物流仓库管理系统</title>
        <meta content="webkit" name="renderer"/>
        <link href="../../css/font.css" rel="stylesheet"/>
        <link href="../../css/xadmin.css" rel="stylesheet"/>
        <script charset="utf-8" src="../../lib/layui/layui.js"></script>
        <script src="../../js/xadmin.js" type="text/javascript"></script>
        <script src="../../js/vue2.7min.js"></script>
        <script src="../../js/axios.min.js"></script>
        <style media="screen" type="text/css">
            #managerImage {
                width: 100px;
                height: 100px;
                border: 1px solid blue;
                border-radius: 100%;
                overflow: hidden;
            }

            img {
                max-height: 100%;
            }
        </style>

    </head>
    <body class="index">
        <div id="app">
            <!-- 顶部开始 -->
            <div class="container">
                <div class="logo">
                    <a href="./index.html">提瓦特物流仓库管理系统</a></div>
                <div class="left_open">
                    <a><i class="iconfont" title="展开左侧栏">&#xe699;</i></a>
                </div>
                <ul class="layui-nav right" lay-filter="">
                    <li class="layui-nav-item">
                        <a href="javascript:" v-text="managerName"></a>
                        <dl class="layui-nav-child">
                            <!-- 二级菜单 -->
                            <dd>
                                <a @click="logout">登出</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
            <!-- 顶部结束 -->
            <!-- 中部开始 -->
            <!-- 左侧菜单开始 -->
            <div class="left-nav">
                <div id="side-nav">
                    <ul id="nav">
                        <!--开始左侧菜单栏-->




                        <li>
                            <div id="managerImage" style="margin:  auto;">
                                <img :src="managerImage" alt="error" style="margin:  auto;">
                            </div>
                        </li>


                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="管理员管理">&#xe6b8;</i>
                                <cite>管理员管理</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('管理员信息展示','../manager/manager-list.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>管理员信息展示</cite></a>
                                </li>

                            </ul>
                        </li>

                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="供应商管理">&#xe6b8;</i>
                                <cite>供应商管理</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('供应商信息展示','../supplier/supplier-list.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>供应商信息展示</cite></a>
                                </li>

                            </ul>
                        </li>
                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="商品管理">&#xe6b8;</i>
                                <cite>商品管理</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('商品信息展示','../goods/goods-list.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>商品信息展示</cite></a>
                                </li>

                            </ul>
                        </li>
                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="仓库管理">&#xe6b8;</i>
                                <cite>仓库管理</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('仓库信息展示','../warehouse/warehouse-list.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>仓库信息展示</cite></a>
                                </li>

                            </ul>
                        </li>
                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="出入库记录">&#xe6b8;</i>
                                <cite>出入库记录</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('入库信息展示','../log/buy-log.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>入库记录</cite></a>
                                </li>

                            </ul>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('出库信息展示','../log/sell-log.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>出库记录</cite></a>
                                </li>

                            </ul>
                        </li>
                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="顾客管理">&#xe6b8;</i>
                                <cite>顾客管理</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('顾客信息展示','../customer/customer-list.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>顾客信息展示</cite></a>
                                </li>

                            </ul>
                        </li>
                        <li>
                            <a href="javascript:">
                                <i class="iconfont left-nav-li" lay-tips="通知">&#xe6b8;</i>
                                <cite>通知</cite>
                                <i class="iconfont nav_right">&#xe697;</i></a>
                            <ul class="sub-menu">
                                <li>
                                    <a onclick="xadmin.add_tab('通知','../notice/notice-list.html')">
                                        <i class="iconfont">&#xe6a7;</i>
                                        <cite>通知列表</cite></a>
                                </li>

                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <!-- <div class="x-slide_left"></div> -->
            <!-- 左侧菜单结束 -->
            <!-- 右侧主体开始 -->
            <div class="page-content">
                <div class="layui-tab tab" lay-allowclose="false" lay-filter="xbs_tab">
                    <ul class="layui-tab-title">
                        <li class="home">
                            <i class="layui-icon">&#xe68e;</i>我的桌面
                        </li>
                    </ul>
                    <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
                        <dl>
                            <dd data-type="this">关闭当前</dd>
                            <dd data-type="other">关闭其它</dd>
                            <dd data-type="all">关闭全部</dd>
                        </dl>
                    </div>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <iframe class="x-iframe" frameborder="0" scrolling="yes" src='./welcome.html'></iframe>
                        </div>
                    </div>
                    <div id="tab_show"></div>
                </div>
            </div>
            <div class="page-content-bg"></div>
            <style id="theme_style"></style>
            <!-- 右侧主体结束 -->
            <!-- 中部结束 -->

            <script type="text/javascript">
                var vm = new Vue({
                        el: "#app",
                        data: {
                            //Manager信息
                            managerId: null,
                            managerName: null,
                            managerPassword: null,
                            managerRealName: null,
                            managerSex: null,
                            managerPhone: null,
                            managerState: null,
                            managerLevel: null,
                            managerImage: null,


                        },
                        methods: {
                            //登出功能
                            logout() {
                                axios.post("../../../manager/logout")
                                    .then(function (response) {
                                        console.log(response);
                                        vm.msg = response.data.msg;
                                        //判断是否登录
                                        if (response.data.code === 1) {
                                            //页面跳转
                                            window.location.href = '../login.html?msg=登出成功';
                                        }
                                    }, function (err) {
                                        console.log(err);

                                    })
                            },
                            //获取管理员信息
                            getManager() {
                                axios.post("../../../manager/getManager")
                                    .then(function (response) {
                                        //数据保存到vue全局
                                        if (response.data.code === 1) {
                                            //Manager信息
                                            vm.managerId = response.data.data.managerId;
                                            vm.managerName = response.data.data.managerName
                                            vm.managerPassword = response.data.data.managerPassword
                                            vm.managerRealName = response.data.data.managerRealName
                                            vm.managerSex = response.data.data.managerSex
                                            vm.managerPhone = response.data.data.managerPhone
                                            vm.managerState = response.data.data.managerState
                                            vm.managerLevel = response.data.data.managerLevel
                                            vm.managerImage = "../../../pc/managerImage/" + response.data.data.managerImage;
                                        }
                                    }, function (err) {
                                        console.log(err);

                                    })
                            }
                        }
                        ,
                        mounted: function () {
                            console.log("进入index页面，查询管理员信息");
                            //查询管理员信息
                            this.getManager();
                        }
                    })
                ;
            </script>

        </div>
    </body>

</html>